package com.myjavalab.thinkinginjava4;

public class OrderOfInitialization {
	public static void main(String[] args) {
		Card c = new Card();
		c.f(); // Shows that construction is done
		
	}
}

class Tag {
	Tag(int marker) {
		System.out.println("Tag(" + marker + ")");
	}
	
	Tag() {
		System.out.println("Tag");
	}
	
	public void g(){
		System.out.println("g");
	}
}

class Card {
	Tag t1 = new Tag(1); // Before constructor

	Card() {
		// Indicate we're in the constructor:
		System.out.println("Card()");
		t3 = new Tag(33); // Re-initialize t3
	}

	Tag t2 = new Tag(2); // After constructor

	void f() {
		System.out.println("f()");
	}

	Tag t3 = new Tag(3); // At end
	
	static Tag t5;
	static {
		t5 = new Tag(5);
		t5.g();
	}
	
	static Tag t4 = new Tag(4);
	
}
